home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / gfx / misc / gnuplot-3.7src.lha / gnuplot-3.7src / gnuplot-3.7.lha / gnuplot-3.7 / term / kyo.trm < prev    next >
Text File  |  1998-11-26  |  6KB  |  221 lines

  1. /*
  2.  * $Id: kyo.trm,v 1.12 1998/04/14 00:17:52 drd Exp $
  3.  *
  4.  */
  5.  
  6. /* Prescribe (KYOCERA) driver - Michael Waldor */
  7.  
  8. /*[
  9.  * Copyright 1990 - 1993, 1998
  10.  *
  11.  * Permission to use, copy, and distribute this software and its
  12.  * documentation for any purpose with or without fee is hereby granted,
  13.  * provided that the above copyright notice appear in all copies and
  14.  * that both that copyright notice and this permission notice appear
  15.  * in supporting documentation.
  16.  *
  17.  * Permission to modify the software is granted, but not the right to
  18.  * distribute the complete modified source code.  Modifications are to
  19.  * be distributed as patches to the released version.  Permission to
  20.  * distribute binaries produced by compiling modified sources is granted,
  21.  * provided you
  22.  *   1. distribute the corresponding source modifications from the
  23.  *    released version in the form of a patch file along with the binaries,
  24.  *   2. add special version identification to distinguish your version
  25.  *    in addition to the base release version number,
  26.  *   3. provide your name and address as the primary contact for the
  27.  *    support of your modified version, and
  28.  *   4. retain our contact information in regard to use of the base
  29.  *    software.
  30.  * Permission to distribute the released version of the source code along
  31.  * with corresponding source modifications in the form of a patch file is
  32.  * granted with same provisions 2 through 4 for binary distributions.
  33.  *
  34.  * This software is provided "as is" without express or implied warranty
  35.  * to the extent permitted by applicable law.
  36. ]*/
  37.  
  38. /* Modified for gnuplot 2.0 sk@sun4 24-Apr-1990 13:23 */
  39.  
  40. /*
  41.  * adapted to the new terminal layout by Stefan Bodewig (Dec. 1995)
  42.  */
  43.  
  44. #include "driver.h"
  45.  
  46. #ifdef TERM_REGISTER
  47. register_term(prescribe)
  48. register_term(kyo)
  49. #endif
  50.  
  51. #ifdef TERM_PROTO
  52. TERM_PUBLIC void PRE_init __PROTO((void));
  53. TERM_PUBLIC void KYO_init __PROTO((void));
  54. TERM_PUBLIC void PRE_graphics __PROTO((void));
  55. TERM_PUBLIC void PRE_text __PROTO((void));
  56. TERM_PUBLIC void PRE_linetype __PROTO((int linetype));
  57. TERM_PUBLIC void PRE_move __PROTO((unsigned int x, unsigned int y));
  58. TERM_PUBLIC void PRE_vector __PROTO((unsigned int x, unsigned int y));
  59. TERM_PUBLIC void PRE_put_text __PROTO((unsigned int x, unsigned int y, char *str));
  60. TERM_PUBLIC int PRE_justify_text __PROTO((enum JUSTIFY mode));
  61. TERM_PUBLIC void PRE_reset __PROTO((void));
  62.  
  63. #define PRE_XMAX 2567
  64. #define PRE_YMAX 1815        /* X:Y = sqrt(2) */
  65.  
  66. #define PRE_VCHAR (PRE_YMAX/30)
  67. #define PRE_HCHAR 33        /* about 9 chars per inch */
  68. #define PRE_HTIC (PRE_XMAX/80)
  69. #define PRE_VTIC PRE_HTIC
  70.  
  71. /* for Courier font: */
  72. #define KYO_VCHAR (14*(300/72))    /* 12 pt + 2 pt baselineskip */
  73. #define KYO_HCHAR (300/10)    /*  10 chars per inch */
  74. #endif /* TERM_PROTO */
  75.  
  76. #ifndef TERM_PROTO_ONLY
  77. #ifdef TERM_BODY
  78.  
  79. #define PRE_XLAST (PRE_XMAX - 1)
  80. #define PRE_YLAST (PRE_YMAX - 1)
  81.  
  82. enum JUSTIFY pre_justify = LEFT;    /* text is flush left */
  83.  
  84. TERM_PUBLIC void PRE_init()
  85. {
  86.     fputs("!R! RES;\n", gpoutfile);
  87.     /* UNIT: units are dots, 300 dots = 1 in = 72 pt */
  88.     /* SPO: landscape format */
  89.     /* STM, SLM set top, left margin */
  90.     /* Font: bold Helvetica (proportional font) */
  91.     fputs("PAGE; UNIT D; SPO L; STM 280; SLM 440;\n", gpoutfile);
  92.     fputs("FTMD 15; FONT 29; SCPI 9;\n", gpoutfile);
  93. }
  94.  
  95. TERM_PUBLIC void KYO_init()
  96. {
  97.     fputs("!R! RES;\n", gpoutfile);
  98.     /* UNIT: units are dots, 300 dots = 1 in = 72 pt */
  99.     /* SPO: landscape format */
  100.     /* STM, SLM set top, left margin */
  101.     /* Font: Courier (fixed width font) */
  102.     fputs("PAGE; UNIT D; SPO L; STM 280; SLM 440;\n", gpoutfile);
  103.     fputs("FTMD 15; FONT 17; SCPI 10;\n", gpoutfile);
  104. }
  105.  
  106. TERM_PUBLIC void PRE_graphics()
  107. {
  108. }
  109.  
  110. TERM_PUBLIC void PRE_text()
  111. {                /* eject page after each plot */
  112.     fputs("PAGE;\n", gpoutfile);
  113. }
  114.  
  115. TERM_PUBLIC void PRE_linetype(linetype)
  116. int linetype;
  117. {
  118.     /* actually choose pendiameter */
  119.     if (linetype < 0)
  120.     linetype = -linetype;
  121.     else
  122.     linetype = 3;
  123.     (void) fprintf(gpoutfile, "SPD %d;\n", linetype);
  124. }
  125.  
  126. TERM_PUBLIC void PRE_move(x, y)
  127. unsigned int x, y;
  128. {
  129.     (void) fprintf(gpoutfile, "MAP %1d,%1d;\n", x, PRE_YMAX - y);
  130. }
  131.  
  132. TERM_PUBLIC void PRE_vector(x, y)
  133. unsigned int x, y;
  134. {
  135.     (void) fprintf(gpoutfile, "DAP %1d, %1d;\n", x, PRE_YMAX - y);
  136. }
  137.  
  138. TERM_PUBLIC void PRE_put_text(x, y, str)
  139. unsigned int x, y;
  140. char *str;
  141. {
  142.     PRE_move(x, y);
  143.     switch (pre_justify) {
  144.     case RIGHT:
  145.     (void) fprintf(gpoutfile, "RTXT \"%s\", B;\n", str);
  146.     break;
  147.     default:
  148.     (void) fprintf(gpoutfile, "TEXT \"%s\", B;\n", str);
  149.     }
  150. }
  151.  
  152. TERM_PUBLIC int PRE_justify_text(mode)
  153. enum JUSTIFY mode;
  154. {
  155.     pre_justify = mode;
  156.     switch (pre_justify) {
  157.     case LEFT:
  158.     case RIGHT:
  159.     return (TRUE);
  160.     default:
  161.     return (FALSE);
  162.     }
  163.  
  164. }
  165.  
  166. TERM_PUBLIC void PRE_reset()
  167. {
  168.     fputs("PAGE; RES; EXIT;\n", gpoutfile);
  169. }
  170.  
  171. #endif /* TERM_BODY */
  172.  
  173. #ifdef TERM_TABLE
  174. TERM_TABLE_START(prescribe_driver)
  175.     "prescribe", "Prescribe - for the Kyocera Laser Printer",
  176.     PRE_XMAX, PRE_YMAX, PRE_VCHAR, PRE_HCHAR,
  177.     PRE_VTIC, PRE_HTIC, options_null, PRE_init, PRE_reset,
  178.     PRE_text, null_scale, PRE_graphics, PRE_move, PRE_vector,
  179.     PRE_linetype, PRE_put_text, null_text_angle,
  180.     PRE_justify_text, line_and_point, do_arrow, set_font_null
  181. TERM_TABLE_END(prescribe_driver)
  182.  
  183. #undef LAST_TERM
  184. #define LAST_TERM prescribe_driver
  185.  
  186. TERM_TABLE_START(kyo_driver)
  187.     "kyo", "Kyocera Laser Printer with Courier font",
  188.     PRE_XMAX, PRE_YMAX, KYO_VCHAR, KYO_HCHAR,
  189.     PRE_VTIC, PRE_HTIC, options_null, KYO_init, PRE_reset,
  190.     PRE_text, null_scale, PRE_graphics, PRE_move, PRE_vector,
  191.     PRE_linetype, PRE_put_text, null_text_angle,
  192.     PRE_justify_text, line_and_point, do_arrow, set_font_null
  193. TERM_TABLE_END(kyo_driver)
  194.  
  195. #undef LAST_TERM
  196. #define LAST_TERM kyo_driver
  197.  
  198. #endif /* TERM_TABLE */
  199. #endif /* TERM_PROTO_ONLY */
  200.  
  201. #ifdef TERM_HELP
  202. START_HELP(kyo)
  203. "1 kyo",
  204. "?commands set terminal kyo",
  205. "?set terminal kyo",
  206. "?set term kyo",
  207. "?terminal kyo",
  208. "?term kyo",
  209. "?kyo",
  210. "?commands set terminal prescribe",
  211. "?set terminal prescribe",
  212. "?set term prescribe",
  213. "?terminal prescribe",
  214. "?term prescribe",
  215. "?prescribe",
  216. " The `kyo` and `prescribe` terminal drivers support the Kyocera laser printer.",
  217. " The only difference between the two is that `kyo` uses \"Helvetica\" whereas",
  218. " `prescribe` uses \"Courier\".  There are no options."
  219. END_HELP(kyo)
  220. #endif
  221.